package com.csun.cmny.provider.controller;

import com.csun.cmny.core.support.BaseController;
import com.csun.cmny.provider.mapper.NtReviseMapper;
import com.csun.cmny.provider.model.domain.NtIeType;
import com.csun.cmny.provider.model.domain.NtRevise;
import com.csun.cmny.provider.service.NtIeTypeService;
import com.csun.cmny.provider.service.NtReviseService;
import com.csun.cmny.util.wrapper.WrapMapper;
import com.csun.cmny.util.wrapper.Wrapper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-12-10 15:14
 * @Description:
 */
@RestController
@RequestMapping(value = "/api")
public class NtIeTypeController {

    @Resource
    private NtIeTypeService ntIeTypeService;
    @Resource
    private NtReviseService ntReviseService;

    /**
     *  cn_omc_expense_type 费用表 (nt_ietype)
     *  cn_omc_expense_type_model_code
     *  cn_omc_expense_item (nt_ietype_item)
     *
     *  cn_omc_tmp_expense_item - 费用映射临时表
     */
    @PostMapping(value = "/ieTypeInit")
    public Wrapper ieTypeInit(Integer homeId, Long groupId) {

        Integer result = ntIeTypeService.ieTypeInit(homeId, groupId);

        return WrapMapper.ok();
    }

    /**
     * act_*
     * cn_omc_revise_var
     *
     * nt_revise
     *
     * 调房调级流程
     */
    @PostMapping(value = "/reviseInit")
    public Wrapper reviseInit(Integer homeId, Long groupId) {

        // ntReviseService.processInit(homeId, groupId);

        ntReviseService.reviseInit(homeId, groupId);

        return WrapMapper.ok();
    }

}
